/*
 * =====================================================================================
 *
 *       Filename:  BinaryTree.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  11/14/2012 11:12:53 AM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Kjeldahl (), 
 *   Organization:  
 *
 * =====================================================================================
 */
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>

#define SIZE 100
#define elmType int

typedef struct BinaryNode{
	elmType data[SIZE];
	int lflag=0,rflag=0;
	struct BinaryNode *lChild;
	struct BinaryNode *rChild;
}BinaryNode,*BinaryTree;

void initBT();
void emptyBT(BinaryTree BT);
void destroyBT(BinaryTree BT);
bool isempty(BinaryTree BT);
void createBT(BinaryTree BT);
int TreeDepth(BinaryTree BT);
BinaryNode * Root(BinaryTree BT);
BinaryNode * Parent(BinaryTree BT,BinaryNode *BN);
BinaryNode *LeftChild(BinaryTree BT,BinaryNode *BN);
BinaryNode *RightChild(BinaryTree BT,BinaryNode *BN);
BinaryNode *LeftSibing(BinaryTree BT,BinaryNode *BN);
BinaryNode *RightSibing(BinaryTree BT,BinaryNode *BN);
bool InsertChild(BinaryTree BT,BinaryNode *BN,int LR,BinaryNode *Ins);
bool DeleteChild(BinaryTree BT,BinaryNode *BN,int LR);
void TraverseTree(BinaryTree BT);
BinaryNode *locateBT(BinaryTree BT,elmType value);





